<template>
	<view class="container">
		<u-skeleton
			rows="5"
			title
			rowsHeight="30"
			:loading="!info.cid"
		>
			<view class="content">
				<u-parse :content="info.content"></u-parse>
			</view>
		</u-skeleton>
	</view>
</template>

<script>
	import { getArticleDetail } from '@/api/home'
	export default {
		data() {
			return {
				info: {}
			}
		},
		onLoad(o) {
			this.getInfo(o)
		},
		methods: {
			async getInfo(o) {
				let res = {}
				if (o.tags) {
					res = await getArticleDetail({ tags: o.tags })
				}
				uni.setNavigationBarTitle({
					title: res.data.title
				})
				this.info = res.data
			}
		},
		async onShareTimeline() {
			return {
				title: this.info.title,
				path: `/pages/protocol?tags=${this.info.tags}`
			}
		},
		async onShareAppMessage() {
			return {
				title: this.info.title,
				path: `/pages/protocol?tags=${this.info.tags}`
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #fff;
}
.container {
	padding: 20rpx 20rpx 30rpx;
	.content {
		font-size: 26rpx;
		color: #000;
		white-space: break-spaces;
		font-weight: bold;
	}
}
</style>
